<?php 

echo $this->element('top_menu', array('auth', $auth));

// print_r($users);

?>



<h1>Utenti</h1>

<form action="/test_1/users/add" method="post">
	
	<table>
	    <tr>
	        <th>Id</th>
	        <th>Login</th>
	        <th>Stato</th>
	        <th>Scadenza</th>
	        <th>Ultimo Accesso</th>
	        <th>Registrazione</th>
	        <th>Gruppo</th>
	    </tr>
	    <!-- Here is where we loop through our $posts array, printing out post info -->
		<?php foreach ($users as $user): ?> 
		<tr>
			<td><?php echo $user['User']['id']; ?></td> 
			<td><?php echo $this->Html->link($user['User']['username'], array('controller' => 'users', 'action' => 'edit', $user['User']['id'])); ?></td>
			<td><?php echo $user['User']['stato']; ?></td> 
			<td><?php echo $user['User']['dt_scadenza']; ?></td> 
			<td><?php echo $user['User']['dt_accesso']; ?></td> 
			<td><?php echo $user['User']['registrazione']; ?></td> 
			<td><?php echo $user['Group']['descrizione']; ?></td> 
			<td><?php echo $this->Html->link('X', array('controller' => 'users', 'action' => 'delete', $user['User']['id'])); ?></td>
		</tr>
		<?php endforeach; ?>
		<?php unset($users); ?> 
	</table>

	<input type="submit" value="Aggiungi" />
</form>